package cn.njxzc.examples;

import java.util.TreeMap;

public class Exam8_10 {
	private static final Integer ONE = new Integer(1);

	@SuppressWarnings({ "rawtypes", "unchecked" })
	public static void main(String[] args) {
		TreeMap m = new TreeMap();
		for (int i = 0; i < args.length; i++) {
			Integer freq = (Integer) m.get(args[i]);
			m.put(args[i], (freq == null ? ONE : new Integer(
					freq.intValue() + 1)));
		}
		System.out.println("不同的单词有 " + m.size() + "个");
		System.out.println(m);

	}

}
